package com.jk.user.util;

import java.io.Serializable;
import java.util.List;

//mybatis分页实体
public class PageEntity<T> implements Serializable {

	private Integer totalCount;//总条数
	
	private Integer totalPage;//总页数
	
	private Integer cpage = 1;//当前页
	
	private Integer pageSize = 3;//每页条数
	
	private Integer startIndex;//开始下标
	
	private Integer endIndex;//结束下标
	
	private List<T> list;
	
	
	public List<T> getList() {
		return list;
	}
	public void setList(List<T> list) {
		this.list = list;
	}
	public Integer getEndIndex() {
		this.endIndex = this.cpage * this.pageSize;
		return endIndex;
	}
	public void setEndIndex(Integer endIndex) {
		this.endIndex = endIndex;
	}
	public Integer getTotalCount() {
		return totalCount;
	}
	public void setTotalCount(Integer totalCount) {
		this.totalCount = totalCount;
		this.totalPage = this.totalCount % this.pageSize == 0 ? this.totalCount / this.pageSize : this.totalCount / this.pageSize + 1;
	}
	public Integer getTotalPage() {
		return totalPage;
	}
	public void setTotalPage(Integer totalPage) {
		this.totalPage = totalPage;
	}
	public Integer getCpage() {
		return cpage;
	}
	public void setCpage(Integer cpage) {
		this.cpage = cpage;
	}
	public Integer getPageSize() {
		return pageSize;
	}
	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}
	public Integer getStartIndex() {
		this.startIndex = (this.cpage - 1) * this.pageSize + 1;
		return startIndex;
	}
	public void setStartIndex(Integer startIndex) {
		this.startIndex = startIndex;
	}
	
}
